<!DOCTYPE html>
<!-- saved from url=(0068)http://www.17sucai.com/preview/1268063/2018-08-02/Friends/index.html -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>人脉会员</title>
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<link href="/carworld_weixin/css/myMembers-style.css" rel="stylesheet" type="text/css">
<script src="/carworld_weixin/js/jquery-3.3.1.min.js"></script>
<script src="/carworld_weixin/js/tab.js"></script>
<style type="text/css">
.tb960x90 {
	display: none !important;
	display: none
}
.badge {
    position: absolute;
    display: inline-block;
    padding: 0 6px;
    font-size: 12px;
    text-align: center;
    background-color: #FF5722;
    color: #fff;
    border-radius: 10px;
    line-height: 16px;
    left: 60px;
}
</style>
</head>
<body>

	<section class="aui-flexView">
		<header class="aui-navBar aui-navBar-fixed">
			<a href="javascript:history.back(-1)" class="aui-navBar-item">
				<i class="icon icon-return"></i>
			</a>
			<div class="aui-center">
				<span class="aui-center-title">我的分红人脉</span>
			</div>
			<a href="javascript:;" class="aui-navBar-item">
				<i class="icon icon-sys"></i>
			</a>
		</header>
		<section class="aui-scrollView">
			<div class="aui-tab-box" data-ydui-tab="">
				<ul class="tab-nav">
					<li class="tab-nav-item tab-active">
						<a href="javascript:;" onclick="getAllMember(1)"><span class="badge" id="directNum"></span>直接人脉</a>
					</li>
					<li class="tab-nav-item">
						<a href="javascript:;" onclick="getAllMember(2)"><span class="badge" id="indirectNum"></span>间接人脉</a>
					</li>
				</ul>
				<!-- 直接人脉 -->
				<div class="tab-panel">
					<div class="tab-panel-item tab-active">
						<div class="tab-item" id="direct">
						
						</div>
					</div>

					<!-- 直接人脉 -->
					<div class="tab-panel-item">
						<div class="tab-item" id="indirect">
							
						</div>
					</div>
				</div>
			</div>
		</section>
	</section>

<script>
$(function() {// 初始化内容
	getAllMember(1);
}); 

//直接人脉
 function getAllMember(e){
	$('.tab-item').empty();
	var source = e;
	$.ajax({
		type : 'GET',
		url : '/carworld_weixin/vipcard/myConnection',
		dataType : 'json',
		data : {
			'source' : source
		},
		contentType : 'application/json',
		success : function(data) {
			var count=data.page.totalRow;
			if(0==count){
				$('.message-widget').append('<div style="text-align:center;font-size:14px;color:#bbb;">还没有小伙伴领取你的会员卡哦~</div>');
				return;
			}
			
			if(source==1){
				$("#directNum").html(count);
			}else{
				$("#indirectNum").html(count);
			}
			
			$.each(data.page.list, function(index, elem) {
				var html=
					'<a href="javascript:;" class="aui-list-item"><div class="aui-list-item-hd"><img src="'+elem.user_photo+'" alt=""><span class="aui-well-comm-vip">'+
					'<img src="/carworld_weixin/images/icon-png/icon-vip.png" alt=""></span></div><div class="aui-list-item-bd"><h4>'+elem.name+'</h4><p>绑定时间：'+elem.create_time+'</p></div>'+
					'<span class="aui-list-item-fr"><img src="/carworld_weixin/images/icon-png/icon-follow-002.png" alt=""><p>已绑定</p></span></a>'
					
					if(source==1){
						$('#direct').append(html);
					}else{
						$('#indirect').append(html);
					}
			});
		}
	}); 
	 
} 




</script> 

</body>
</html>